import  * as class_transformer_1  from 'class-transformer';

export default async function deleteOneOfSoft(req) {
  //软删除
  const { returnDeleted } = req.options.routes.deleteOneBase;
  const found = await this.getOneOrFail(req, returnDeleted);
  const deleted = await this.repo.softRemove(found);
  const toReturn = returnDeleted
      ? class_transformer_1.plainToClass(this.entityType, { ...found })
      : undefined;
  return toReturn;
}